package com.igoal.service;

import com.igoal.exception.NoContactServiceFoundException;

public class ContactServiceFactory {
	private static ContactServiceFactory instance = null;
	
	private ContactServiceFactory(){}
	
	public static ContactServiceFactory getInstance(){
		if(instance == null){
			instance = new ContactServiceFactory();
		}
		return instance;
	}	
	
	public ContactService getContactService(ContactVendorEnum vendor) throws NoContactServiceFoundException{
		if(ContactVendorEnum.GMAIL.equals(vendor)){
			return new GmailContactServiceImpl();
		}
		throw new NoContactServiceFoundException();
	}
}
